<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
     function fn(nums) {
      // 按位或：两个数的值相等为1（0除外），不相等也为1
      return nums.reduce((pre, cur) => pre | cur, 0);
    }
    console.log(fn([3,2,4,6]))
  </script>
</body>
</html>